<?php
/* @var $this yii\web\View */


use backend\models\Goods;
use yii\bootstrap\Html;
use yii\widgets\LinkPager;

$this->title = "商品回收站";

$this->params['breadcrumbs'][]=[
    'label'=>'商品列表',
    'url'=>['goods/list'],
    'options'=>['class'=>'btn btn-default btn-warning']
];
$this->params['breadcrumbs'][]=$this->title;


?>

<div class="container table-responsive">
    <table class="table table-hover">
        <tr>
            <td width="20%">名称</td>
            <td>分类名称</td>
            <td>货号</td>
            <td>状态</td>
            <td>库存</td>
            <td>更新时间</td>
            <td>操作</td>
        </tr>
        <?php foreach($models as $model): ?>
            <tr>
                <td><?=$model->name?></td>
                <td><?=Goods::categorysAll()[$model->goods_category_id]?></td>
                <td><?=$model->sn?></td>
                <td><?=Goods::$statusValue[$model->status]?></td>
                <td><?=$model->stock?></td>
                <td><?=date('y-m-d H:m:s',$model->update_at)?></td>
                <td>
                    <?=Html::a('恢复',['goods/recovery','id'=>$model->id],['class'=>'btn btn-info'])?>
                    <?=Html::a('彻底删除',['goods/delete','id'=>$model->id],[
                        'class'=>'btn btn-danger',
                        'data'=>[
                            'confirm'=>'确认删除!删除后数据将无法找回...',
                            'method'=>'post',
                        ],
                    ])?>
                </td>
            </tr>
        <?php endforeach;?>
    </table>

    <?=LinkPager::widget([
        'pagination'=>$pager,
        'prevPageLabel'=>'上一页',
        'nextPageLabel'=>'下一页',
    ])?>


</div>
